package pattern.delegate.simple;

import java.util.HashMap;
import java.util.Map;

/**
 * @author juxiaojun
 * @since 2019-05-01
 */
public class Leader {
    //预先知道每个员工的特长、特征来分发任务
    private Map<String,IEmployee> register=new HashMap<String, IEmployee>();

    public Leader(){
        register.put("加密",new EmployeeA());
        register.put("架构",new EmployeeB());
    }

    public void doing(String command){
        register.get(command).doing(command);
    }
}
